/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.hl7.v3.impl;

import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.BasicFeatureMap;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.InternalEList;

import org.hl7.v3.StrucDocFootnote;
import org.hl7.v3.StrucDocFootnoteRef;
import org.hl7.v3.StrucDocLinkHtml;
import org.hl7.v3.V3Package;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Struc Doc Link Html</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getMixed <em>Mixed</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getGroup <em>Group</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getFootnote <em>Footnote</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getFootnoteRef <em>Footnote Ref</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getHref <em>Href</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getID <em>ID</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getLanguage <em>Language</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getName <em>Name</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getRel <em>Rel</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getRev <em>Rev</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getStyleCode <em>Style Code</em>}</li>
 *   <li>{@link org.hl7.v3.impl.StrucDocLinkHtmlImpl#getTitle <em>Title</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class StrucDocLinkHtmlImpl extends EObjectImpl implements StrucDocLinkHtml {
	/**
	 * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMixed()
	 * @generated
	 * @ordered
	 */
	protected FeatureMap mixed;

	/**
	 * The default value of the '{@link #getHref() <em>Href</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getHref()
	 * @generated
	 * @ordered
	 */
	protected static final String HREF_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getHref() <em>Href</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getHref()
	 * @generated
	 * @ordered
	 */
	protected String href = HREF_EDEFAULT;

	/**
	 * The default value of the '{@link #getID() <em>ID</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getID()
	 * @generated
	 * @ordered
	 */
	protected static final String ID_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getID() <em>ID</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getID()
	 * @generated
	 * @ordered
	 */
	protected String iD = ID_EDEFAULT;

	/**
	 * The default value of the '{@link #getLanguage() <em>Language</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLanguage()
	 * @generated
	 * @ordered
	 */
	protected static final String LANGUAGE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getLanguage() <em>Language</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLanguage()
	 * @generated
	 * @ordered
	 */
	protected String language = LANGUAGE_EDEFAULT;

	/**
	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected String name = NAME_EDEFAULT;

	/**
	 * The default value of the '{@link #getRel() <em>Rel</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRel()
	 * @generated
	 * @ordered
	 */
	protected static final String REL_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getRel() <em>Rel</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRel()
	 * @generated
	 * @ordered
	 */
	protected String rel = REL_EDEFAULT;

	/**
	 * The default value of the '{@link #getRev() <em>Rev</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRev()
	 * @generated
	 * @ordered
	 */
	protected static final String REV_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getRev() <em>Rev</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRev()
	 * @generated
	 * @ordered
	 */
	protected String rev = REV_EDEFAULT;

	/**
	 * The default value of the '{@link #getStyleCode() <em>Style Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStyleCode()
	 * @generated
	 * @ordered
	 */
	protected static final List<String> STYLE_CODE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getStyleCode() <em>Style Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getStyleCode()
	 * @generated
	 * @ordered
	 */
	protected List<String> styleCode = STYLE_CODE_EDEFAULT;

	/**
	 * The default value of the '{@link #getTitle() <em>Title</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTitle()
	 * @generated
	 * @ordered
	 */
	protected static final String TITLE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getTitle() <em>Title</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTitle()
	 * @generated
	 * @ordered
	 */
	protected String title = TITLE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected StrucDocLinkHtmlImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return V3Package.eINSTANCE.getStrucDocLinkHtml();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public FeatureMap getMixed() {
		if (mixed == null) {
			mixed = new BasicFeatureMap(this, V3Package.STRUC_DOC_LINK_HTML__MIXED);
		}
		return mixed;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public FeatureMap getGroup() {
		return (FeatureMap)getMixed().<FeatureMap.Entry>list(V3Package.eINSTANCE.getStrucDocLinkHtml_Group());
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<StrucDocFootnote> getFootnote() {
		return getGroup().list(V3Package.eINSTANCE.getStrucDocLinkHtml_Footnote());
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<StrucDocFootnoteRef> getFootnoteRef() {
		return getGroup().list(V3Package.eINSTANCE.getStrucDocLinkHtml_FootnoteRef());
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getHref() {
		return href;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setHref(String newHref) {
		String oldHref = href;
		href = newHref;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_LINK_HTML__HREF, oldHref, href));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getID() {
		return iD;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setID(String newID) {
		String oldID = iD;
		iD = newID;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_LINK_HTML__ID, oldID, iD));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLanguage() {
		return language;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLanguage(String newLanguage) {
		String oldLanguage = language;
		language = newLanguage;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_LINK_HTML__LANGUAGE, oldLanguage, language));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName(String newName) {
		String oldName = name;
		name = newName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_LINK_HTML__NAME, oldName, name));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getRel() {
		return rel;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setRel(String newRel) {
		String oldRel = rel;
		rel = newRel;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_LINK_HTML__REL, oldRel, rel));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getRev() {
		return rev;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setRev(String newRev) {
		String oldRev = rev;
		rev = newRev;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_LINK_HTML__REV, oldRev, rev));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public List<String> getStyleCode() {
		return styleCode;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setStyleCode(List<String> newStyleCode) {
		List<String> oldStyleCode = styleCode;
		styleCode = newStyleCode;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_LINK_HTML__STYLE_CODE, oldStyleCode, styleCode));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTitle(String newTitle) {
		String oldTitle = title;
		title = newTitle;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.STRUC_DOC_LINK_HTML__TITLE, oldTitle, title));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case V3Package.STRUC_DOC_LINK_HTML__MIXED:
				return ((InternalEList<?>)getMixed()).basicRemove(otherEnd, msgs);
			case V3Package.STRUC_DOC_LINK_HTML__GROUP:
				return ((InternalEList<?>)getGroup()).basicRemove(otherEnd, msgs);
			case V3Package.STRUC_DOC_LINK_HTML__FOOTNOTE:
				return ((InternalEList<?>)getFootnote()).basicRemove(otherEnd, msgs);
			case V3Package.STRUC_DOC_LINK_HTML__FOOTNOTE_REF:
				return ((InternalEList<?>)getFootnoteRef()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case V3Package.STRUC_DOC_LINK_HTML__MIXED:
				if (coreType) return getMixed();
				return ((FeatureMap.Internal)getMixed()).getWrapper();
			case V3Package.STRUC_DOC_LINK_HTML__GROUP:
				if (coreType) return getGroup();
				return ((FeatureMap.Internal)getGroup()).getWrapper();
			case V3Package.STRUC_DOC_LINK_HTML__FOOTNOTE:
				return getFootnote();
			case V3Package.STRUC_DOC_LINK_HTML__FOOTNOTE_REF:
				return getFootnoteRef();
			case V3Package.STRUC_DOC_LINK_HTML__HREF:
				return getHref();
			case V3Package.STRUC_DOC_LINK_HTML__ID:
				return getID();
			case V3Package.STRUC_DOC_LINK_HTML__LANGUAGE:
				return getLanguage();
			case V3Package.STRUC_DOC_LINK_HTML__NAME:
				return getName();
			case V3Package.STRUC_DOC_LINK_HTML__REL:
				return getRel();
			case V3Package.STRUC_DOC_LINK_HTML__REV:
				return getRev();
			case V3Package.STRUC_DOC_LINK_HTML__STYLE_CODE:
				return getStyleCode();
			case V3Package.STRUC_DOC_LINK_HTML__TITLE:
				return getTitle();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case V3Package.STRUC_DOC_LINK_HTML__MIXED:
				((FeatureMap.Internal)getMixed()).set(newValue);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__GROUP:
				((FeatureMap.Internal)getGroup()).set(newValue);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__FOOTNOTE:
				getFootnote().clear();
				getFootnote().addAll((Collection<? extends StrucDocFootnote>)newValue);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__FOOTNOTE_REF:
				getFootnoteRef().clear();
				getFootnoteRef().addAll((Collection<? extends StrucDocFootnoteRef>)newValue);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__HREF:
				setHref((String)newValue);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__ID:
				setID((String)newValue);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__LANGUAGE:
				setLanguage((String)newValue);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__NAME:
				setName((String)newValue);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__REL:
				setRel((String)newValue);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__REV:
				setRev((String)newValue);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__STYLE_CODE:
				setStyleCode((List<String>)newValue);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__TITLE:
				setTitle((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case V3Package.STRUC_DOC_LINK_HTML__MIXED:
				getMixed().clear();
				return;
			case V3Package.STRUC_DOC_LINK_HTML__GROUP:
				getGroup().clear();
				return;
			case V3Package.STRUC_DOC_LINK_HTML__FOOTNOTE:
				getFootnote().clear();
				return;
			case V3Package.STRUC_DOC_LINK_HTML__FOOTNOTE_REF:
				getFootnoteRef().clear();
				return;
			case V3Package.STRUC_DOC_LINK_HTML__HREF:
				setHref(HREF_EDEFAULT);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__ID:
				setID(ID_EDEFAULT);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__LANGUAGE:
				setLanguage(LANGUAGE_EDEFAULT);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__NAME:
				setName(NAME_EDEFAULT);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__REL:
				setRel(REL_EDEFAULT);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__REV:
				setRev(REV_EDEFAULT);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__STYLE_CODE:
				setStyleCode(STYLE_CODE_EDEFAULT);
				return;
			case V3Package.STRUC_DOC_LINK_HTML__TITLE:
				setTitle(TITLE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case V3Package.STRUC_DOC_LINK_HTML__MIXED:
				return mixed != null && !mixed.isEmpty();
			case V3Package.STRUC_DOC_LINK_HTML__GROUP:
				return !getGroup().isEmpty();
			case V3Package.STRUC_DOC_LINK_HTML__FOOTNOTE:
				return !getFootnote().isEmpty();
			case V3Package.STRUC_DOC_LINK_HTML__FOOTNOTE_REF:
				return !getFootnoteRef().isEmpty();
			case V3Package.STRUC_DOC_LINK_HTML__HREF:
				return HREF_EDEFAULT == null ? href != null : !HREF_EDEFAULT.equals(href);
			case V3Package.STRUC_DOC_LINK_HTML__ID:
				return ID_EDEFAULT == null ? iD != null : !ID_EDEFAULT.equals(iD);
			case V3Package.STRUC_DOC_LINK_HTML__LANGUAGE:
				return LANGUAGE_EDEFAULT == null ? language != null : !LANGUAGE_EDEFAULT.equals(language);
			case V3Package.STRUC_DOC_LINK_HTML__NAME:
				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
			case V3Package.STRUC_DOC_LINK_HTML__REL:
				return REL_EDEFAULT == null ? rel != null : !REL_EDEFAULT.equals(rel);
			case V3Package.STRUC_DOC_LINK_HTML__REV:
				return REV_EDEFAULT == null ? rev != null : !REV_EDEFAULT.equals(rev);
			case V3Package.STRUC_DOC_LINK_HTML__STYLE_CODE:
				return STYLE_CODE_EDEFAULT == null ? styleCode != null : !STYLE_CODE_EDEFAULT.equals(styleCode);
			case V3Package.STRUC_DOC_LINK_HTML__TITLE:
				return TITLE_EDEFAULT == null ? title != null : !TITLE_EDEFAULT.equals(title);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (mixed: ");
		result.append(mixed);
		result.append(", href: ");
		result.append(href);
		result.append(", iD: ");
		result.append(iD);
		result.append(", language: ");
		result.append(language);
		result.append(", name: ");
		result.append(name);
		result.append(", rel: ");
		result.append(rel);
		result.append(", rev: ");
		result.append(rev);
		result.append(", styleCode: ");
		result.append(styleCode);
		result.append(", title: ");
		result.append(title);
		result.append(')');
		return result.toString();
	}

} //StrucDocLinkHtmlImpl
